package com.sherlockHolmes.init.service.impl;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sherlockHolmes.init.entity.dao.UserRole;
import com.sherlockHolmes.init.service.UserRoleService;
import com.sherlockHolmes.init.mapper.UserRoleMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author 四月一日 君寻
* @description 针对表【user_role】的数据库操作Service实现
* @createDate 2024-03-25 17:01:22
*/
@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole>
    implements UserRoleService{
    @Resource
    private UserRoleMapper userRoleMapper;
    @Override
    public List<UserRole> getRole(Integer id) {
        List<UserRole> list = new LambdaQueryChainWrapper<UserRole>(userRoleMapper)
                .eq(UserRole::getUserId, id)
                .list();
        return list;
    }
}




